package com.justgame.project.service.system.service;

import com.justgame.project.cloud.base.entity.WeChatAuthResult;
import com.justgame.project.service.system.entity.SysUserInfo;
import com.justgame.project.service.system.service.basic.BasicSysUserInfoService;
import com.justgame.project.service.system.vo.UserAuthorizationResult;
import org.springframework.lang.NonNull;

import javax.servlet.http.HttpServletRequest;

/**
 *
 * 用户信息表服务接口层
 *
 * @@tableName sys_user_info
 * @author Zwb
 */
public interface ISysUserInfoService extends BasicSysUserInfoService {
    /**
     * 通过账号密码登录
     * @return 用户信息
     */
    UserAuthorizationResult loginByUserNameAndPassword(String userName, String password);

    /**
     * 邮箱登录
     * @return 用户信息
     */
    UserAuthorizationResult loginByEmail(String eMail, String eMailCode);

    /**
     * 通过手机号登录
     * @return 用户信息
     */
    UserAuthorizationResult loginByPhoneNumber(String phoneNumber, String smsCode);

    /**
     * 通过微信登录
     * @return 用户信息
     */
    UserAuthorizationResult loginByWx(WeChatAuthResult authResult);
    /**
     * 更新邮箱
     * @param sysUserInfo 用户信息
     * @param email 邮箱
     * @param emailCode 验证码
     */
    boolean changeEmail(SysUserInfo sysUserInfo, String email, String emailCode);

    /**
     * 退出登录
     */
    boolean logout(SysUserInfo userInfo, HttpServletRequest request);

    /**
     * 微信注册（绑定手机）
     * @return 用户信息
     */
    UserAuthorizationResult wxRegister(@NonNull String phoneNumber,@NonNull WeChatAuthResult authResult);
}
